﻿using UnityEngine;

/// <summary>
/// 火元素与燃烧元素
/// </summary>
public class GeneralFireAura : IGeneralElementAura
{
    private readonly IElementHolder _holder;
    private readonly IElementAura _fireAura;
    private readonly IElementAura _burningAura;

    public GeneralFireAura(IElementHolder holder)
    {
        _holder = holder;
        _fireAura = _holder.GetElementAura("火");
        _burningAura = _holder.GetElementAura("燃烧");
    }

    public float Gauge => Mathf.Max(_fireAura.Gauge, _burningAura.Gauge);

    public void UseGauge(float cost)
    {
        _fireAura.Gauge -= cost;
        _burningAura.Gauge -= cost;
    }
}